Modify javascript to display a SharePoint list from another site collection, want items to open in a modal dialog [on hold]

Posted by FRD on Programmers See other posts from Programmers or by FRD
Published on 2014-08-22T17:24:00Z Indexed on 2014/08/22 22:32 UTC
Read the original article Hit count: 217

Filed under:
|

I'm trying to modify the javascript below so that when a list from one site collection is displayed in another site collection and an item is selected, it opens in a dialog box instead of taking over the entire page and forcing the user to the originating site.

<div id="ExternalListContainer"></div>
<script type="text/javascript">
  //wait for SP to load up
  ExecuteOrDelayUntilScriptLoaded(
        function LoadExternalList() {
  //turn on xsite scripting support for jquery
    $.support.cors = true;
    //load the external SP list
    $("#ExternalListContainer").load("http://originatingsiteurl.aspx table.ms-listviewtable", 
        function(response, status, xhr) {
      //find all the list items and convert to HTML so we don't see the code
      $("#ExternalListContainer").find(".ms-vb2").each(function () {
         $(this).html($(this).text());
      });
    });
  }, "sp.ribbon.js");
</script>

© Programmers or respective owner

Related posts about JavaScript

Related posts about sharepoint